export default function request(config = {}){
	let {url,} = config
	return new Promise((resolve,reject)=>{
		uni.request({
			url: '',
			header: {},
			success:(res)=>{
				if(res.data.code === 200){
					resolve(res.data) 
				} else if(res.data.code === 400){
					uni.showModal({
						title: '错误提示',
						content: res.data.msg,
						showCancel: false
					})
					reject(res.data)
				} else{
					uni.showToast({
						title:res.data.msg,
						icon: 'none'
					})
					reject(res.data)
				}
			},
			fail:(err)=>{
				reject(err)
			},
			complete:()=>{
				
			}
		})
	})
	
}